package com.tiantian.common.core.domain.model;

import com.tiantian.common.core.constant.UserConstants;
import com.tiantian.common.core.constraints.xss.Xss;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

/**
 * 用户登录对象
 *
 * @author Lion Li
 */
@Data
@NoArgsConstructor
public class LoginBody {
    /**
     * 用户名
     */
    @NotBlank(message = "账号不能为空")
    @Xss(message = "用户账号不能包含任何脚本字符")
    @Length(min = UserConstants.PASSWORD_MIN_LENGTH, max = UserConstants.PASSWORD_MAX_LENGTH, message = "用户名长度需要在5-20之间")
    private String username;

    /**
     * 用户密码
     */
    @NotBlank(message = "密码不能为空")
    @Length(min = UserConstants.PASSWORD_MIN_LENGTH, max = UserConstants.PASSWORD_MAX_LENGTH, message = "密码长度不符合规则")
    private String password;

    /**
     * 验证码
     */
    private String captcha;

    /**
     * 唯一标识
     */
    private String uuid;

}
